package com.team.service.impl;

import com.team.mapper.AppCategoryMapper;
import com.team.pojo.AppCategory;
import com.team.pojo.AppCategoryExample;
import com.team.service.AppCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AppCategoryServiceImpl implements AppCategoryService {
 @Autowired
 private AppCategoryMapper appCategoryMapper;
 @Override
 public List<AppCategory> getAppCategory(Long id) {
  AppCategoryExample appCategoryExample=new AppCategoryExample();
  AppCategoryExample.Criteria criteria=appCategoryExample.createCriteria();
  if (id==null){
   criteria.andParentidIsNull();
  }else {
   criteria.andParentidEqualTo(id);
  }
  return appCategoryMapper.selectByExample(appCategoryExample);
 }
}
